<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>PDOStatement 类</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="pdo.setattribute.html">PDO::setAttribute</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="pdostatement.bindcolumn.html">PDOStatement::bindColumn</a></div>
 <div class="up"><a href="book.pdo.html">PDO</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="class.pdostatement" class="reference">
 <h1 class="title"> PDOStatement 类</h1>
 
 
 <div class="partintro"><p class="verinfo">(PHP 5 &gt;= 5.1.0, PECL pdo &gt;= 1.0.0)</p>
 

  <div class="section" id="pdostatement.intro">
   <h2 class="title">简介</h2>
   <p class="para">
    代表一条预处理语句，并在该语句被执行后代表一个相关的结果集。
   </p>
  </div>

 
  <div class="section" id="pdostatement.synopsis">
   <h2 class="title">类摘要</h2>
 

   <div class="classsynopsis">
    <div class="ooclass"></div>
 

    <div class="classsynopsisinfo">
     <span class="ooclass">
      <strong class="classname">PDOStatement</strong>
     </span>
 
     <span class="oointerface">implements 
      <span class="interfacename"><strong class="interfacename">Traversable</strong></span>
     </span>
     {</div>

 
    <div class="classsynopsisinfo classsynopsisinfo_comment">/* 属性 */</div>
    <div class="fieldsynopsis"><span class="modifier">readonly</span> <span class="type">string</span> <var class="varname"><a href="class.pdostatement.html#pdostatement.props.querystring">$<var class="varname">queryString</var></a></var>;</div>

    
    <div class="classsynopsisinfo classsynopsisinfo_comment">/* 方法 */</div>
    <div class="methodsynopsis dc-description">
    <span class="type">bool</span><span class="methodname"><a href="pdostatement.bindcolumn.html" class="methodname">bindColumn</a></span>
     ( <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <code class="parameter">$column</code></span>
    , <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <code class="parameter reference">&$param</code></span>
    [, <span class="methodparam"><span class="type">int</span> <code class="parameter">$type</code></span>
    [, <span class="methodparam"><span class="type">int</span> <code class="parameter">$maxlen</code></span>
    [, <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <code class="parameter">$driverdata</code></span>
   ]]] )</div>
<div class="methodsynopsis dc-description">
   <span class="type">bool</span><span class="methodname"><a href="pdostatement.bindparam.html" class="methodname">bindParam</a></span>
    ( <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <code class="parameter">$parameter</code></span>
   , <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <code class="parameter reference">&$variable</code></span>
   [, <span class="methodparam"><span class="type">int</span> <code class="parameter">$data_type</code><span class="initializer"> = PDO::PARAM_STR</span></span>
   [, <span class="methodparam"><span class="type">int</span> <code class="parameter">$length</code></span>
   [, <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <code class="parameter">$driver_options</code></span>
  ]]] )</div>
<div class="methodsynopsis dc-description">
   <span class="type">bool</span><span class="methodname"><a href="pdostatement.bindvalue.html" class="methodname">bindValue</a></span>
    ( <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <code class="parameter">$parameter</code></span>
   , <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <code class="parameter">$value</code></span>
   [, <span class="methodparam"><span class="type">int</span> <code class="parameter">$data_type</code><span class="initializer"> = PDO::PARAM_STR</span></span>
  ] )</div>
<div class="methodsynopsis dc-description">
   <span class="type">bool</span><span class="methodname"><a href="pdostatement.closecursor.html" class="methodname">closeCursor</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="type">int</span><span class="methodname"><a href="pdostatement.columncount.html" class="methodname">columnCount</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="type">bool</span><span class="methodname"><a href="pdostatement.debugdumpparams.html" class="methodname">debugDumpParams</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="type">string</span><span class="methodname"><a href="pdostatement.errorcode.html" class="methodname">errorCode</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="type">array</span><span class="methodname"><a href="pdostatement.errorinfo.html" class="methodname">errorInfo</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="type">bool</span><span class="methodname"><a href="pdostatement.execute.html" class="methodname">execute</a></span>
    ([ <span class="methodparam"><span class="type">array</span> <code class="parameter">$input_parameters</code></span>
  ] )</div>
<div class="methodsynopsis dc-description">
   <span class="type">mixed</span><span class="methodname"><a href="pdostatement.fetch.html" class="methodname">fetch</a></span>
    ([ <span class="methodparam"><span class="type">int</span> <code class="parameter">$fetch_style</code></span>
   [, <span class="methodparam"><span class="type">int</span> <code class="parameter">$cursor_orientation</code><span class="initializer"> = PDO::FETCH_ORI_NEXT</span></span>
   [, <span class="methodparam"><span class="type">int</span> <code class="parameter">$cursor_offset</code><span class="initializer"> = 0</span></span>
  ]]] )</div>
<div class="methodsynopsis dc-description">
   <span class="type">array</span><span class="methodname"><a href="pdostatement.fetchall.html" class="methodname">fetchAll</a></span>
    ([ <span class="methodparam"><span class="type">int</span> <code class="parameter">$fetch_style</code></span>
   [, <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <code class="parameter">$fetch_argument</code></span>
   [, <span class="methodparam"><span class="type">array</span> <code class="parameter">$ctor_args</code><span class="initializer"> = array()</span></span>
  ]]] )</div>
<div class="methodsynopsis dc-description">
   <span class="type">string</span><span class="methodname"><a href="pdostatement.fetchcolumn.html" class="methodname">fetchColumn</a></span>
    ([ <span class="methodparam"><span class="type">int</span> <code class="parameter">$column_number</code><span class="initializer"> = 0</span></span>
  ] )</div>
<div class="methodsynopsis dc-description">
   <span class="type">mixed</span><span class="methodname"><a href="pdostatement.fetchobject.html" class="methodname">fetchObject</a></span>
    ([ <span class="methodparam"><span class="type">string</span> <code class="parameter">$class_name</code><span class="initializer"> = &quot;stdClass&quot;</span></span>
   [, <span class="methodparam"><span class="type">array</span> <code class="parameter">$ctor_args</code></span>
  ]] )</div>
<div class="methodsynopsis dc-description">
   <span class="type">mixed</span><span class="methodname"><a href="pdostatement.getattribute.html" class="methodname">getAttribute</a></span>
    ( <span class="methodparam"><span class="type">int</span> <code class="parameter">$attribute</code></span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="type">array</span><span class="methodname"><a href="pdostatement.getcolumnmeta.html" class="methodname">getColumnMeta</a></span>
    ( <span class="methodparam"><span class="type">int</span> <code class="parameter">$column</code></span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="type">bool</span><span class="methodname"><a href="pdostatement.nextrowset.html" class="methodname">nextRowset</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="type">int</span><span class="methodname"><a href="pdostatement.rowcount.html" class="methodname">rowCount</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="type">bool</span><span class="methodname"><a href="pdostatement.setattribute.html" class="methodname">setAttribute</a></span>
    ( <span class="methodparam"><span class="type">int</span> <code class="parameter">$attribute</code></span>
   , <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <code class="parameter">$value</code></span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="type">bool</span><span class="methodname"><a href="pdostatement.setfetchmode.html" class="methodname">setFetchMode</a></span>
    ( <span class="methodparam"><span class="type">int</span> <code class="parameter">$mode</code></span>
   )</div>

 
   }</div>

  </div>
 
  <div class="section" id="pdostatement.props">
   <h2 class="title">属性</h2>
   <dl>

    
     <dt id="pdostatement.props.querystring"><var class="varname"><var class="varname">queryString</var></var></dt>

     <dd>

      <p class="para">
       所用的查询字符串
      </p>
     </dd>

    
   </dl>

 </div>
 
 </div>
 
 











































































































































































 
<h2>Table of Contents</h2><ul class="chunklist chunklist_reference"><li><a href="pdostatement.bindcolumn.html">PDOStatement::bindColumn</a> — 绑定一列到一个 PHP 变量</li><li><a href="pdostatement.bindparam.html">PDOStatement::bindParam</a> — 绑定一个参数到指定的变量名</li><li><a href="pdostatement.bindvalue.html">PDOStatement::bindValue</a> — 把一个值绑定到一个参数</li><li><a href="pdostatement.closecursor.html">PDOStatement::closeCursor</a> — 关闭游标，使语句能再次被执行。</li><li><a href="pdostatement.columncount.html">PDOStatement::columnCount</a> — 返回结果集中的列数</li><li><a href="pdostatement.debugdumpparams.html">PDOStatement::debugDumpParams</a> — 打印一条 SQL 预处理命令</li><li><a href="pdostatement.errorcode.html">PDOStatement::errorCode</a> — 获取跟上一次语句句柄操作相关的 SQLSTATE</li><li><a href="pdostatement.errorinfo.html">PDOStatement::errorInfo</a> — 获取跟上一次语句句柄操作相关的扩展错误信息</li><li><a href="pdostatement.execute.html">PDOStatement::execute</a> — 执行一条预处理语句</li><li><a href="pdostatement.fetch.html">PDOStatement::fetch</a> — 从结果集中获取下一行</li><li><a href="pdostatement.fetchall.html">PDOStatement::fetchAll</a> — 返回一个包含结果集中所有行的数组</li><li><a href="pdostatement.fetchcolumn.html">PDOStatement::fetchColumn</a> — 从结果集中的下一行返回单独的一列。</li><li><a href="pdostatement.fetchobject.html">PDOStatement::fetchObject</a> — 获取下一行并作为一个对象返回。</li><li><a href="pdostatement.getattribute.html">PDOStatement::getAttribute</a> — 检索一个语句属性</li><li><a href="pdostatement.getcolumnmeta.html">PDOStatement::getColumnMeta</a> — 返回结果集中一列的元数据</li><li><a href="pdostatement.nextrowset.html">PDOStatement::nextRowset</a> — 在一个多行集语句句柄中推进到下一个行集</li><li><a href="pdostatement.rowcount.html">PDOStatement::rowCount</a> — 返回受上一个 SQL 语句影响的行数</li><li><a href="pdostatement.setattribute.html">PDOStatement::setAttribute</a> — 设置一个语句属性</li><li><a href="pdostatement.setfetchmode.html">PDOStatement::setFetchMode</a> — 为语句设置默认的获取模式。</li></ul>
</div>
<hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="pdo.setattribute.html">PDO::setAttribute</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="pdostatement.bindcolumn.html">PDOStatement::bindColumn</a></div>
 <div class="up"><a href="book.pdo.html">PDO</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
